Skip to content

Conversation

bquorning
Copy link
Contributor

In this PR we do two things:

  • Instruct SimpleCov to ignore unreachable code. When a case or if exhausts all branches, but the last when/elsif documents behavior we don't want to just change it to a fallback else. In that case we add a :noop or raise ArgumentError and use :nocov: to tell SimpleCov to ignore it.
  • Adds test coverage to spec/rubocop/cop/rspec_rails/http_status_spec.rb for when the rack gem is not loaded.

Those two commits bring line and branch coverage to 100% ✨


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

@bquorning bquorning requested a review from a team as a code owner February 12, 2025 12:05
SimpleCov.start do
enable_coverage :branch
minimum_coverage line: 95.17, branch: 85.13
minimum_coverage line: 100, branch: 100
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯/💯

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@bquorning bquorning force-pushed the improve-test-coverage branch from 362c6a9 to 7ae719f Compare February 12, 2025 13:18
@bquorning bquorning merged commit cc58bde into master Feb 12, 2025
27 checks passed
@bquorning bquorning deleted the improve-test-coverage branch February 12, 2025 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants